home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 781 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: fc.hp.com!news
  2. From: koren@hpsrk.fc.hp.com (Steve Koren)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Exec Semaphores
  5. Date: 11 Jan 1996 07:48:11 -0700
  6. Organization: HP Fort Collins Site
  7. Sender: koren@hpsrk.fc.hp.com
  8. Message-ID: <oj6rax6iy8k.fsf@hpsrk.fc.hp.com>
  9. References: <390.6583T950T852@wonder.ca>
  10. NNTP-Posting-Host: hpsrk.fc.hp.com
  11. In-reply-to: paulf@wonder.ca's message of 10 Jan 1996 20:53:52 GMT
  12. X-Newsreader: Gnus v5.0.9
  13.  
  14.  
  15. paulf@wonder.ca (paulf) wrote:
  16.  
  17. > Does anyone know how the OS semaphores handle the following
  18. > situation:
  19. > Lock Shared from Task 1.
  20. > Lock Exclusive From Task 2.
  21. > Lock Shared from Task 3.
  22. > Unlock from Task 1.
  23.  
  24. > Will the OS let Task 3 into it's critical section straight away, or
  25. > will it stop it from entering until the exclusive lock from Task 2 is
  26. > serviced?  The autodocs don't mention what would happen
  27.  
  28. If T1 holds a shared lock when T2 requests an exclusive one, T2 will
  29. block until no one holds the lock.  In this case, that will be after
  30. both T1 and T3 release the lock.  (Because T1's lock does not block T3).
  31.  
  32. (Well, I think so.  I've never tried exactly that, but it makes sense).
  33.  
  34.    - steve
  35.